
class Solution {
public:
    bool isSymmetric(TreeNode* root) {
        

        return issametree(root->left,root->right);
    }

    bool issametree(TreeNode*left,TreeNode* right)
    {
        if(left==nullptr||right==nullptr) return left==right;
        return left->val==right->val&&issametree(left->left,right->right)&&
        issametree(right->left,left->right);
    }

};